package com.archetypus.projectschedule.web.people.cmd;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.archetypus.projectschedule.common.Configuration;
import com.archetypus.projectschedule.common.dto.people.PersonListHandler;
import com.archetypus.projectschedule.common.exceptions.ProjectSchedulerException;
import com.archetypus.projectschedule.web.common.cmd.ICommand;
import com.archetypus.projectschedule.web.people.bd.IPersonBD;
import com.archetypus.projectschedule.web.people.bd.PersonBD;

public class ListPersonCmd implements ICommand {

	public void execute(HttpServletRequest request,HttpServletResponse response) throws ProjectSchedulerException {
		IPersonBD personBD = new PersonBD();
		PersonListHandler listHandler = personBD.listPeople();
		request.setAttribute("personList", listHandler.getList());
		request.setAttribute("pageSize", Configuration.getInstance().get("pageSize"));
	}

}
